<h1>Slike u zaglavlju sajta</h1>
<p>* Preporučene dimenzije slika su 800x130px rezolucije 72dpi</p>

<?= $this->Form->create("Headphoto", array('url'=>'/admin_head_photos/save', 'enctype'=>'multipart/form-data')) ?>
	<?= $this->Form->hidden("type", array("value"=>"default")) ?>
	<fieldset>
		<legend>Podrazumevana slika:</legend>
		<?= $this->Html->image('headphotos/default.jpg') ?>
	
		<?= $this->Form->label("image", "Promenite sliku:") ?>
		<?= $this->Form->file("image") ?>
		<?= $this->Form->submit("Sačuvaj", array('div'=>false)) ?>
	</fieldset>
<?= $this->Form->end() ?>

<fieldset>
	<legend>Specifične slike</legend>
	<p><?= $this->Html->link("+ dodaj sliku", "/admin_head_photos/create") ?></p>
	<? if(!empty($headphotos)): ?>
	<table>
		<tr>
			<th>Kategorija</th>
			<th>Identifikator</th>
			<th>Slika</th>
			<th></th>
		</tr>
		<? foreach($headphotos as $photo): ?>
		<? $photo = $photo['Headphoto'] ?>
		<tr>
			<td><?= $this->Html->link($headphoto_entities[$photo['entity']], "/admin_head_photos/edit/".$photo['id']) ?></td>
			<td><?= $photo['entity_id'] ?></td>
			<td><?= $this->Html->image("headphotos/".$photo['image']."?w=100") ?></td>
			<td>
				<?= $this->Html->link("obriši", "/admin_head_photos/delete/".$photo['id'], array("confirm"=>"Da li želite da obrišete sliku u zaglavlju?")) ?>
			</td>
		</tr>
		<? endforeach; ?>
	</table>
	<? endif; ?>
</fieldset>
